package com.hitgo.soccer.config;

import org.apache.log4j.Logger;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class ServerConfig {

	/**
	 * Chat Server address
	 */
	public static boolean	isQQ = true;
	
	public static String APP_ID = "12567";

	public static String APP_NAME = "app12567";

	public static String APP_KEY = "7cb5e3d412004aa1bbe7c42fadfc5a11";

	public static String JT_SECRET = "314294335B518C34";

	public static String SECRET_KEY = "52589762";

	
	public static int nDBCount = 1;
	public static String strDBConfigPath = "./";
	/**
	 * Load configs from files.
	 */
	public static void loadConfig(String strFile)
	{
		if (strFile == null || strFile.isEmpty())
			return;
			
		// 获取文档的根元素，赋值给rootElement变量
		Element rootElement = ConfigUtil.GetRootElement(strFile);
		if(rootElement == null)
			return ;
		
		Node nodeDB = rootElement.getElementsByTagName("database").item(0);
		nDBCount = ConfigUtil.GetAttributeIntValue(nodeDB, "count");
		strDBConfigPath = ConfigUtil.GetAttributeStrValue(nodeDB, "path");
	}
}
